<link rel="stylesheet" type="text/css" href="<?php echo base_url()."style.css"; ?>" />
<style type="text/css">
#warning
{
padding:10px;
margin-bottom:0px;
background-color:#E77471;
border-width:1px;
border-style: solid;
border-color:#A80000;
}
#success
{
padding:10px;
margin-bottom:0px;
background-color:#A8CBD4;
border-width:1px;
border-style: solid;
border-color:#04637A;
}
#headline 
{
font-weight:bold;
font-size:110%;
color:#e56506;
}

#ui-datepicker-div
{
left: 394px;
}

body
{
background-image: url(<?php echo base_url()."/images/white.gif"; ?>);
background-repeat: repeat-xy;
}

#grey
{
background-color: #E0E0E0;
}

.rightside
{
width:500px;
background-color: #E7EFEF;
border-style:solid;
border-width:1px;
border-color:#ff0000;
padding:10px 0 10px 20px;
align:center;
}
#admin
{
align:center;
}
</style>
<html>
<head>
<title>Admin</title>
	<meta charset="UTF-8" />


</head>
<body>
<!--search for the city first-->
					<?php	echo form_open('admin_search_city'); ?>
							<?php if(strcmp($success,"")!=0) {?>
							<p id="success"><?php echo $success; ?></p>
							<?php }?>
							<?php if(strcmp($warning,"")!=0) {?>
							<p id="warning"><?php echo $warning; ?></p>
							<?php }?>
<center>
<table width="75%" align="center">	
	<tr>
		<td align="center">
			<div id="admin">
							<h2 id="font">Admin Panel - Lel-Ltd</h2>
							<a href="<?php echo base_url()."admin"; ?>">Back to Admin Home</a>
							<br />
							<br />
			</div>
		</td>
	</tr>
	<tr>
		<td>		
				<table width="100%" align="center" style="border-width:1px; border-style: solid; border-color:#04637A; padding:20px 0 20px 0;">
					<tr>
						<td width="30%"></td>
						<td id="headline">Search City<br/><br/></td>
						<td></td>
						<td width="30%"></td>
					</tr>
					<tr>
						<td width="30%"></td>
						<td width="20%">Search City :</td>
						<td id="right" align=left><input name="search" type="text" value="<?php echo $search;?>" ></td>
						<td width="30%"></td>
					</tr>
					<tr>
						<td width="30%"></td>
						<td colspan="2"><?php	echo form_submit('search_city', 'Search');	?>	</td>
						<td></td>
						<td width="30%"></td>
					</tr>
				</table>
				<table  width="100%" style="padding:20px 0 20px 0;">
					<?php 
						if(isset($search_city_list) && count($search_city_list))
						{
					?>
							<tr>
								<td width="50%"><?php if(count($search_city_list)==1) echo "1 city was found.";else echo count($search_city_list)." cities were found.";?> <br><br></td>
								<td width="20%"></td>
								<td width="5%"></td>
							</tr>
							<tr>
<!--								<td align="center"><b>ID</b></td>	-->
								<td><b>City </b></td>
								<td><b>Province </b></td>
								<td><b>Country</b></td>
								<td width="5%"><b>Delete</b></td>
							</tr>
					<?php 
							for($i=0;$i<count($search_city_list);$i++) 
							{
								if($i%2==1)
								{
					?>
								<tr>
					<?php   	}
								else 
								{
					?>								
								<tr id="grey">
					<?php 		}				?>
<!--									<td align="center"><?php echo $search_city_list[$i]['id']; ?></td>	-->
									<td><?php echo $search_city_list[$i]['city']; ?></td>
									<td><?php echo $search_city_list[$i]['prov']; ?></td>
									<td><?php echo $search_city_list[$i]['country']; ?></td>
			<!--					<td><input type="hidden" name="hidden_city_id" value=<?php echo $search_city_list[$i]['id']; ?> /></td>
									<td><?php	echo form_submit('delete_city', 'Delete City');	?>	</td>	-->
									<td align="center"><img src="<?php echo base_url()."images/delete.png"; ?>" title="Delete this item" style="cursor:pointer" onclick="if(confirm('Are you sure you want to delete the City <?php echo $search_city_list[$i]['city']; ?> ?')) document.location = '<?php echo base_url()."admin_search_city/delete_city/".$search_city_list[$i]['id']."/".$search_city_list[$i]['city']; ?>';"></td>
								</tr>
					<?php 
								
							}
						}
/*
						else if(isset($search_province_list) && count($search_province_list)==0)
						{
							echo "No City with \"".$search."\" was found.";
						}
*/
					?>
				</table>
		</td>
	</tr>
</table>
</center>
<?php			echo form_close(); ?>

</body>
</html>